// import _authorization from "../cache/_authorization";
import _user from "../cache/cache_user";
import _cache from "../utils/_cache";
// import _menus from "../cache/_menus";
import _config from "./_config";
import _router from "./_router";
// import _account from "../cache/_account";

let _system = {

    //登录
    login : function (router, token, user, menus, account) {
        //身份令牌
        // _authorization.set(token)
        //有限期账号密码
        // _account.set(account)
        //用户
        _user.set(user)
        //菜单
        // _menus.set(menus)
        // 注册动态路由
        _router._reload_router()
        //跳转
        router.push(_config.prefix + '/index')
    },

    //登出
    logout : function (router) {
        _cache.session_clear()
        router.push(_config.prefix + '/login');
    },

}

export default _system
